<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <script src="../script/api.js"></script>
    <style>

    </style>
</head>

<body>
    <header id='header' class="aui-bar aui-bar-nav" style="background-color: #03a9f4">
        <a class="aui-pull-left aui-btn" onclick="api.closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" id="middle">
            仓库盘点
        </div>
    </header>
    <div class="aui-content aui-margin-b-15" style="margin-top:0px;">
        <div class="aui-searchbar" id="search" style="position: relative;">
            <div class="aui-searchbar-input aui-border-radius">
                <i class="aui-iconfont aui-icon-search"></i>
                <div class="aui-searchbar-input">
                    <form>
                        <input type="search" placeholder="请输入盘点单号" id="name">
                    </form>
                </div>
            </div>
            <div class="aui-btn aui-btn-primary" style="margin-right: 0.5rem;background-color: #03a9f4" onclick="doSearch()">搜索22</div>
        </div>
        <ul class="ui-selectee" id="tbodyHtml">

        </ul>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../script/public.js"></script>
<script>
    apiready = function() {
        $("#name").focus();
        idSelector = "name";
        // doSearch();
    }

    //调用RFID扫码api
    function doSearch() {
        var moduleUhfRfid = api.require('moduleUhfRfid');
        moduleUhfRfid.startActivityForResult({
            appParam: ""
        }, function (ret, err) {
            if (ret) {
                alert(ret);
            }else{
                alert(err);
            }
        });
    }


    // //查询
    // function doSearch() {
    //     //光标所在id
    //     var idSelector = "";
    //     var name = ""; //盘点单号
    //     //盘点单号
    //     var name = $("#name").val();
    //     if (name != null && name != undefined && name != "") {
    //         name = name.trim();
    //     }

    //     var un = localStorage.getItem('un');
    //     var serverUrl = localStorage.getItem('serverUrl');
    //     var url = serverUrl + "/app/wminventorybillList";
    //     var data = {
    //         values: {
    //             key: name,
    //             appVersion: api.appVersion,

    //             state: 0,
    //             un: un
    //         }
    //     };
    //     api.ajax({
    //         url: url,
    //         method: 'post',
    //         dataType: 'json',
    //         timeout: 30,
    //         returnAll: false,
    //         data: data
    //     }, function(ret, err) {
    //         if (ret) {
    //             var data = JSON.stringify(ret);
    //             var myobj = eval("(" + data + ")");
    //             //返回成功
    //             if (myobj.code == "0") {
    //                 var list = eval(myobj.list);
    //                 var html = "";
    //                 for (var i = 0; i < list.length; i++) {
    //                     html += "<li class='sortable ui-selectee ui-sortable'>";
    //                     html += "<ul class='aui-list aui-media-list ui-selectee'>";
    //                     html += "<li class='aui-list-item  ui-selectee'>";
    //                     html += "<div class='aui-media-list-item-inner ui-selectee'>";
    //                     html += "<div class='aui-list-item-inner ui-selectee'>";
    //                     html += "<div class='aui-list-item-text ui-selectee' style='height: 30px;'>";
    //                     html += "<div class='aui-list-item-label ui-selectee list-tr-title'>盘点单号</div>";
    //                     html += "<div class='aui-list-item-inner ui-selectee'> <font size = \"3\"> " + list[i].code + "</div>";
    //                     html += "</div>";
    //                     html += "<div class='aui-list-item-text ui-selectee' style='height: 30px;'>";
    //                     html += "<div class='aui-list-item-label ui-selectee list-tr-title'>盘点任务号</div>";
    //                     html += "<div class='aui-list-item-inner ui-selectee'> <font size = \"3\"> " + list[i].inventoryTaskCode + "</div>";
    //                     html += "</div>";
    //                     html += "<div class='aui-list-item-text ui-selectee' style='height: 30px;'>";
    //                     html += "<div class='aui-list-item-label ui-selectee list-tr-title'>仓库编码</div>";
    //                     html += "<div class='aui-list-item-inner ui-selectee'> <font size = \"3\">" + list[i].workCenterCode + "</font></div>";
    //                     html += "</div>";
    //                     html += "<div class='aui-list-item-text ui-selectee' style='height: 30px;'>";
    //                     html += "<div class='aui-list-item-label ui-selectee list-tr-title' style='width:150px;'>库位编码</div>";
    //                     html += "<div class='aui-list-item-inner ui-selectee' > <font size = \"3\">  " + list[i].workCellCode + "</font></div>";
    //                     html += "<div class='aui-list-item-right aui-btn ui-selectee'  onclick='goPageDetail(\"" + list[i].sysid + "\",\"" + list[i].code + "\",\"" + list[i].inventoryTaskCode + "\",\"" + list[i].workCenterName + "\",\"" + list[i].workCellId + "\",\"" + list[i].workCellCode + "\",\"" + list[i].workCellName + "\");'>详情</div>";
    //                     html += "</div>";
    //                     html += "</div>";
    //                     html += "</div>";
    //                     html += "</li>";
    //                     html += "</ul>";
    //                     html += "</li>";
    //                 }
    //                 $api.html($api.byId("tbodyHtml"), html);
    //                 //失败
    //             } else if (myobj.code == "1") {
    //                 //清空表格数据
    //                 $api.html($api.byId("tbodyHtml"), "");
    //                 api.toast({
    //                     msg: myobj.message,
    //                     duration: 3000
    //                 });
    //             }
    //         }
    //     });
    // }

    function test() {
        $api.html($api.byId("tbodyHtml"), "");
    }
    //跳转详情页面
    function goPageDetail(sysid, code, inventoryTaskCode, workCenterName, workCellId, workCellCode, workCellName) {
        //打开页面
        api.openWin({
            name: 'uwmInventoryTaskDetail',
            url: 'uwmInventoryTaskDetail' + '.html',
            pageParam: {
                sysid: sysid,
                code: code,
                inventoryTaskCode: inventoryTaskCode,
                workCenterName: workCenterName,
                workCellId: workCellId,
                workCellCode: workCellCode,
                workCellName: workCellName
            },
        });
    }
</script>

</html>
